package hbt;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

import entity.Club;
import entity.IdJugador;
import entity.Jugador;
import entity.Partido;


public class HibernateUtil{
	
	private static SessionFactory sessionFactory=null;
	static{
	try{
		AnnotationConfiguration config = new AnnotationConfiguration();
		
		config.addAnnotatedClass(Club.class);
		config.addAnnotatedClass(Partido.class);
		config.addAnnotatedClass(Jugador.class);
		config.addAnnotatedClass(IdJugador.class);
		sessionFactory = config.buildSessionFactory();
	} catch (Exception e) {
		e.printStackTrace();
	}
	}
	public static SessionFactory getInstancia(){
		return sessionFactory;
	}
	
}
